import React, { Component } from 'react'

class PageList extends React.Component {
    render() {
        const pageArr = []
        // 总页数的遍历
        for (let i=1; i<=this.props.pageSum; i++) {
            pageArr.push(<a onClick={e=>{
                e.preventDefault()
                this.props.getWeibo(i)
            }} key={i} href='' className={this.props.pageNo===i?'active':''}>
            {i}
            </a>)
        }
        return(
            <div className="page">
                {pageArr}
            </div>
            
        )
    }
}
export default PageList